package cn.com.fuhuitong.http

import cn.com.fuhuitong.app.BaseApplication
import cn.com.fuhuitong.R

interface HttpResponseStatus {
    enum class Status {
        START, SUCCESS, FAILURE
    }

    var status: Status
    var exception: Throwable?
    val statusTip: String
        get() = when (status) {
            Status.START -> BaseApplication.INSTANCE.resources.getString(R.string.tip_start)
            Status.SUCCESS -> BaseApplication.INSTANCE.resources.getString(R.string.tip_success)
            Status.FAILURE -> exception?.message ?: BaseApplication.INSTANCE.resources.getString(R.string.unknown_error)
        }
}